﻿namespace Ops.Host.App.ViewModels;

public sealed class ProductionViewModel : AsyncSinglePagedViewModelBase<PtMarkingData, PtMarkingDataFilter>, IViewModel
{
    private readonly IPtProductionService _productionService;

    public ProductionViewModel(IPtProductionService productionService)
    {
        _productionService = productionService;
    }

    protected override async Task<PagedList<PtMarkingData>> OnSearchAsync(int pageIndex, int pageSize)
    {
        return await _productionService.GetPagedListAsync(QueryFilter, pageIndex, pageSize);
    }

    protected override void OnExcelModelCreating(ExcelModelBuilder builder)
    {
        builder.ExcelName = "产能数据";
        builder.SheetName = "产能数据";
    }
}
